<%@ include file="/common/taglibs.jsp"%>
<%@ taglib prefix="product" tagdir="/WEB-INF/tags/product"%>
<title><fmt:message key="orderExpressPrint.heading" /></title>
<META name="decorator" content="printable"/>
<c:set var="noButton" value="true" scope="request"/>
<%
	java.util.Date now = new java.util.Date();
	request.setAttribute("now", now);
%>
<div class="bill_list clearfix">
	<div class="top_head clearfix">
		<div class="logo_r">
			<c:if test="${empty orderExpressList}">
				<b class="red"><fmt:message key="order.print.exTemplate.tip"/></b>&nbsp;&nbsp;&nbsp;&nbsp;
			</c:if>
			<c:if test="${empty orderDeliveryList}">
				<b class="red"><fmt:message key="order.print.consignmentAddress.tip"/></b>&nbsp;&nbsp;&nbsp;&nbsp;
			</c:if>
		</div>
		<div class="txt">
		</div>
	</div>
</div>
<c:if test="${(not empty orderExpressList) and (not empty orderDeliveryList)}">
	<%--<div class="bill_list clearfix">
		<div class="top_head clearfix">
			<div class="logo_r">
				&nbsp;
			</div>
			<div class="txt">
				<fmt:message key="orderExpress.name" />
			</div>
		</div>
		<div class="content_bill clearfix">
			<div class="title clearfix">
				<h2>
					<fmt:message key="orderExpress.orderShipment.documentNo" />
					：${orderShipment.documentNo}
				</h2>
				<span> <fmt:message key="orderPrintList.print.date" /> ： <common:datetimeFormat
						date="${now}" /> </span>
			</div>
		</div>
	</div>--%>
	<%--<div id="expressFormPrinter"
		style="width: 960px; height: 600px; margin: 0 auto;"></div>--%>
		
	<c:choose>
		<c:when test="${count>0}">
			<c:set var="divHeight">${count * 500}</c:set>
			<div id="expressFormPrinter" style="width: 869px; height: ${divHeight}px; margin: 0 auto;"></div>
		</c:when>
		<c:otherwise>
			<div style="width: 100%; margin: 0 auto; text-align: center; color: red;"><br><br><br><br><br><br><fmt:message key="orderExpress.Print.empty" /></div>
		</c:otherwise>
	</c:choose>
		
		
</c:if>
<div class="bill_list clearfix">
	<form id="printMode" method="post">
		<input type="hidden" name="doAction" value="printOrderExpress">
		<div class="box_05">
			<div class="top">
				<fmt:message key="order.print.otherTemplateChoice"/>：
			</div>
			<div class="cnt">
				<c:forEach var="orderExpressItem" items="${orderExpressList}"
					varStatus="vs1">
					<c:choose>
						<c:when
							test="${orderExpressItem.orderExpressId eq defaultOrderExpress.orderExpressId}">
							<a href="javascript:;" class="btn1_curr">${orderExpressItem.orderExpressName}</a>
						</c:when>
						<c:otherwise>
							<a href="javascript:;"
								onclick="$('orderExpressId').value='${orderExpressItem.orderExpressId}';$('printMode').submit();"
								class="btn1">${orderExpressItem.orderExpressName}</a>
						</c:otherwise>
					</c:choose>
					<c:if test="${!vs1.last}"> | </c:if>
				</c:forEach>
			</div>
		</div>
		<div class="box_05">
			<div class="top">
				<fmt:message key="order.print.otherConsignmentMessageChoice"/>：
			</div>
			<div class="cnt">
				<c:forEach var="orderDeliveryItem" items="${orderDeliveryList}"
					varStatus="vs2">
					<c:choose>
						<c:when
							test="${orderDeliveryItem.orderDeliveryId eq defaultOrderDelivery.orderDeliveryId}">
							<a href="javascript:;" class="btn1_curr">${orderDeliveryItem.orderDeliveryName}</a>
						</c:when>
						<c:otherwise>
							<a href="javascript:;"
								onclick="$('orderDeliveryId').value='${orderDeliveryItem.orderDeliveryId}';$('printMode').submit();"
								class="btn1">${orderDeliveryItem.orderDeliveryName}</a>
						</c:otherwise>
					</c:choose>
					<c:if test="${!vs2.last}"> | </c:if>
				</c:forEach>
			</div>
		</div>
		<input type="hidden" name="orderExpressId" id="orderExpressId"
			value="${defaultOrderExpress.orderExpressId}" />
		<input type="hidden" name="orderDeliveryId" id="orderDeliveryId"
			value="${defaultOrderDelivery.orderDeliveryId}" />
	</form>
</div>
<div class="pageBreak"></div>

<c:set var="plugin_swfObject" value="true" scope="request" />
<script type="text/javascript">
<c:if test="${(not empty orderExpressList) and (not empty orderDeliveryList)}">
	$j(document).ready(function(){
		$j("#expressFormPrinter").flash({
			 swf: '${ctxPath}/images/printermode.swf?${now}',
			 width: '100%',
			 height: '100%',
			 wmode: false,
			 //flashvars: {xml:'${defaultOrderExpress.templateData}',data:'${printData}',bg:'${mediaPath}/${defaultOrderExpress.backgroundImageUrl}',copyright:'probiz'},
			 flashvars: {xml:'${defaultOrderExpress.templateData}',order_number:'${count}',data:'${printDatas}',bg:'${mediaPath}/${defaultOrderExpress.backgroundImageUrl}',copyright:'probiz'},
		}); 
	});
</c:if>
</script>
